import unittest
import os
import datetime
from tools.report_handler import report
import settings

print(settings.REPORT_CONFIG['report_dir'])
# 获取当前文件的父目录的路径，main要放在第一层路径下
dir_path = os.path.dirname(__file__)

if __name__ == '__main__':
    suite = unittest.defaultTestLoader.discover(dir_path + '/testcase', 'test*.py')

    # run = bfReport(suite)  # 实例化BeautifulReport
    # run.report(filename=settings.REPORT_CONFIG['filename'] + str(now_time),
    #            description=settings.REPORT_CONFIG['description'], report_dir=settings.BASE_DIE + '/report/')

    # 使用封装报告模块
    report(suite, **settings.REPORT_CONFIG)
